global save_path
save_path = '/Users/apple/IdeaProjects/python-exercise/凡人修仙传'

def write_txt(chapter, content, code):
     open(chapter, 'a', encoding=code)


def main():
    chapter = save_path   + ".txt"
    write_txt(chapter, "aaa", 'utf8')
if __name__ == '__main__':
    main()